﻿<%@ Page Title="" Language="C#" MasterPageFile="~/doanh_nghiep/DNAdminLayout.master" AutoEventWireup="true" CodeFile="lich_su_mua_hang.aspx.cs" Inherits="doanh_nghiep_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="block" id="block-tables">
        <div class="content">
            <h2 class="title">
                Danh sách mua hàng</h2>
            <div class="inner">
                <br />
                <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSourceLichSuMuaHang"
                    AutoGenerateColumns="False" CssClass="table" PageSize="3">
                    <Columns>
                        <asp:BoundField DataField="ho_ten" HeaderText="Họ và tên" SortExpression="ho_ten" />
                        <asp:BoundField DataField="so_dt" HeaderText="Số điện thoại" SortExpression="so_dt" />
                        <asp:BoundField DataField="dia_chi" HeaderText="Địa chỉ" SortExpression="dia_chi" />
                        <asp:BoundField DataField="ten_sp" HeaderText="Tên sản phẩm" SortExpression="ten_sp" />
                        <asp:BoundField DataField="mo_ta_sp" HeaderText="Mô tả sản phẩm" SortExpression="mo_ta_sp" />
                        <asp:BoundField DataField="gia_goc" HeaderText="Giá gốc" SortExpression="gia_goc" />
                        <asp:BoundField DataField="da_thanh_toan" HeaderText="Đã thanh toán" SortExpression="da_thanh_toan" />
                    </Columns>
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSourceLichSuMuaHang" runat="server" ConnectionString="<%$ ConnectionStrings:babydealConnectionString %>"
                    
                    
                    SelectCommand="SELECT thanh_vien.ho_ten, thanh_vien.so_dt, thanh_vien.dia_chi, khuyen_mai.ten_sp, khuyen_mai.mo_ta_sp, mua_hang.id, mua_hang.gia_goc, mua_hang.da_thanh_toan FROM mua_hang INNER JOIN thanh_vien ON mua_hang.id_thanh_vien = thanh_vien.id INNER JOIN khuyen_mai ON mua_hang.id_khuyen_mai = khuyen_mai.id INNER JOIN doanh_nghiep ON khuyen_mai.id_doanh_nghiep = doanh_nghiep.id WHERE  doanh_nghiep.ten_dang_nhap = @ten_dn">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="0" Name="ten_dn" 
                            SessionField="TenDangNhap" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <div class="actions-bar wat-cf">
                </div>
            </div>
        </div>
    </div>
</asp:Content>

